package com.wz.jiangsu.bean.entity.wazuh;

import cn.hutool.json.JSONObject;
import com.wz.jiangsu.bean.entity.AbstractSecurityEventDataCommonDtoToES;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @program: nvsaEngine
 * @author: wangzhou
 * @create: 2023-12-15 14:38
 * @description:
 **/
@Data
@Document(indexName = "wazuh_event_safety")
public class WazuhSecurityEventDataCommonDtoToES extends AbstractSecurityEventDataCommonDtoToES {



    @Id
    @Field(type = FieldType.Keyword)
    private String id;

    @Field(type = FieldType.Nested)
    private JSONObject wazuhEngine;





    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"wazuhEngine\":")
                .append(wazuhEngine);

        sb.append(",\"dataType\":\"")
                .append(dataType).append('\"');

        sb.append(",\"agentIp\":\"")
                .append(agentIp).append('\"');

        sb.append(",\"ts\":")
                .append(ts);

        sb.append(",\"uuid\":\"")
                .append(uuid).append('\"');

        sb.append(",\"seq\":\"")
                .append(seq).append('\"');

        sb.append(",\"payload\":")
                .append(payload);

        sb.append(",\"eventType\":\"")
                .append(eventType).append('\"');

        sb.append(",\"eventLevel\":")
                .append(eventLevel);

        sb.append('}');
        return sb.toString();
    }
}
